Skip to content

Move trailingSlash from kit config to route layout to fix build error#21

Merged
antiero merged 2 commits into
mainfrom
feature/fix-build-failure-in-github-pages
May 4, 2026
Merged

Move trailingSlash from kit config to route layout to fix build error#21
antiero merged 2 commits into
mainfrom
feature/fix-build-failure-in-github-pages

Conversation

@antiero

@antiero antiero commented May 4, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The GitHub Pages build was failing with Unexpected option config.kit.trailingSlash because newer SvelteKit no longer accepts kit.trailingSlash in svelte.config.js.
  • The change preserves the intended routing behavior (always include trailing slashes) while making the config compatible with current SvelteKit.

Description

  • Removed the unsupported trailingSlash key from kit in svelte.config.js.
  • Added export const trailingSlash = 'always'; to src/routes/+layout.ts to apply the same trailing-slash behavior at the route level.
  • Kept appDir: 'assets' and the rest of the kit configuration unchanged.

Testing

  • Ran npm run build after the change and the SvelteKit config parsing error for kit.trailingSlash no longer occurred, but the build aborted later due to a missing optional Rollup native binary in this environment.
  • Ran npm i to try to repair dependencies and received a 403 Forbidden from the npm registry, preventing a successful full build in this environment.

Codex Task

@antiero antiero merged commit 08c2ab9 into main May 4, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant